[Applescript] Getting the file name of files dropped on the script

Posted by Petruza on Stack Overflow See other posts from Stack Overflow or by Petruza
Published on 2010-05-26T21:08:31Z Indexed on 2010/05/26 21:11 UTC
Read the original article Hit count: 176

Filed under:
|
|
|
|

I made this Applescript script to create symbolic links.
Appart from POSIX path of, how can I get the file name, without the path, of the dropped file?

on open filelist
    repeat with i in filelist
        do shell script "ln -s " & POSIX path of i & " /Users/me/Desktop/symlink"
    end repeat
end open

PS: I know this expects many files to be dropped and tries to create many links with the same name, which gives an error. Actually I copied this example from a website and as I don't know almost anything about Applescript, I don't know how to do this for a single file, help on that would be appreciated too.

© Stack Overflow or respective owner

Related posts about macosx

Related posts about path